﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
 public partial class VwCashBook
 {
     public long ID { get; set; }
     public string ReceiptNo { get; set; }
     public DateTime CreateDate { get; set; }
     public int Type { get; set; }
     public string Description { get; set; }
     public int Salon { get; set; }
     public int Sale { get; set; }
     public int Local { get; set; }
     public int Fee { get; set; }
     public int Apartment { get; set; }
     public int PaySchool { get; set; }
     public int PayApartment { get; set; }
     public int MoneyType { get; set; }
     public string MoneyThuVN { get; set; }
     public string MoneyThuUSD { get; set; }
     public string MoneyChiVN { get; set; }
     public string MoneyChiUSD { get; set; }
     public int MoneyInStockVN { get; set; } //so su 
     public int MoneyInStockUSD { get; set; } //so su 
     public string MoneyInStockVNString { get; set; } //so su 
     public string MoneyInStockUSDString { get; set; } //so su 
     public int MoneyThuVNInt { get; set; }
     public int MoneyThuUSDInt { get; set; }
     public int MoneyChiUSDInt { get; set; }
     public int MoneyChiVNInt { get; set; }
     public int Month { get; set; }
     public int Year { get; set; }
     public int PaymentMethod { get; set; }
     public VwCashBook() { }


     static VwCashBook DynamicCast<T>(object row_data, object row_header) where T : VwCashBook
     {
         // row_data : DataRow
         // row_header : DataColumnCollection
         VwCashBook ret = new VwCashBook();
         DataRow dt = (DataRow)row_data;

         foreach (DataColumn column in (DataColumnCollection)row_header)
         {
             switch (column.ColumnName)
             {
                 case "ID":
                     ret.ID = ConvertObject.ToLong(dt[column]);
                         break;
                 case "ReceiptNo":
                         ret.ReceiptNo = ConvertObject.ToString(dt[column]);
                         break;
                 case "CreateDate":
                         ret.CreateDate = ConvertObject.ToDateTime(dt[column]);
                         ret.Month = ret.CreateDate.Month;
                         ret.Year = ret.CreateDate.Year;
                         break;
                 case "Type":
                         ret.Type = ConvertObject.ToInt(dt[column]);
                         break;
                 case "Description":
                         ret.Description = ConvertObject.ToString(dt[column]);
                         break;
                 case "Salon":
                         ret.Salon = ConvertObject.ToInt(dt[column]);
                         break;
                 case "Sale":
                         ret.Sale = ConvertObject.ToInt(dt[column]);
                         break;
                 case "Local":
                         ret.Local = ConvertObject.ToInt(dt[column]);
                         break;
                 case "Fee":
                         ret.Fee = ConvertObject.ToInt(dt[column]);
                         break;
                 case "Apartment":
                         ret.Apartment = ConvertObject.ToInt(dt[column]);
                         break;
                 case "PaySchool":
                         ret.PaySchool = ConvertObject.ToInt(dt[column]);
                         break;
                 case "PayApartment":
                         ret.PayApartment = ConvertObject.ToInt(dt[column]);
                         break;
                 case "MoneyType":
                         ret.MoneyType = ConvertObject.ToInt(dt[column]);
                         break;
                 case "PaymentMethod":
                         ret.PaymentMethod = ConvertObject.ToInt(dt[column]);
                         break;
                 default: break;
             }
         }
         return ret;
     }

  }
}


